export const xToken=():Token=>{
    return new Token()
}

class Token {
    public getXToken = (): string => {
        const xtoken = useCookie("X-Token", { default: (): string => "" });
        return xtoken.value;
      };

    public  setXToken = (token: string): void => {
        let days = 7; //7天后过期
        let date = new Date();
        date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
        const xtoken = useCookie("X-Token", { expires: date });
        xtoken.value = token;
      };
}